import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 车辆运行日志信息 */
export interface RobotOperationLog {
          id: number; // ID
          sn?: string; // 编号
          type?: string; // 类型
          value: string; // 类型对于值
          title?: string; // 标题
          info: string; // 描述
          status?: number; // 状态
  }

// 车辆运行日志 API
export const RobotOperationLogApi = {
  // 查询车辆运行日志分页
  getRobotOperationLogPage: async (params: any) => {
    return await request.get({ url: `/rbt/robot-operation-log/page`, params })
  },

  // 查询车辆运行日志详情
  getRobotOperationLog: async (id: number) => {
    return await request.get({ url: `/rbt/robot-operation-log/get?id=` + id })
  },

  // 新增车辆运行日志
  createRobotOperationLog: async (data: RobotOperationLog) => {
    return await request.post({ url: `/rbt/robot-operation-log/create`, data })
  },

  // 修改车辆运行日志
  updateRobotOperationLog: async (data: RobotOperationLog) => {
    return await request.put({ url: `/rbt/robot-operation-log/update`, data })
  },

  // 删除车辆运行日志
  deleteRobotOperationLog: async (id: number) => {
    return await request.delete({ url: `/rbt/robot-operation-log/delete?id=` + id })
  },

  /** 批量删除车辆运行日志 */
  deleteRobotOperationLogList: async (ids: number[]) => {
    return await request.delete({ url: `/rbt/robot-operation-log/delete-list?ids=${ids.join(',')}` })
  },

  // 导出车辆运行日志 Excel
  exportRobotOperationLog: async (params) => {
    return await request.download({ url: `/rbt/robot-operation-log/export-excel`, params })
  }
}